#include <stdio.h>
#include <string.h>

typedef struct {
    int day;
    char course[10];
} table;

int main() {
    FILE *fp;
    table tab;

    fp = fopen("..\\8\\test-data.txt", "rb+");
    if (fp == NULL) {
        printf("open file fail");
        return -1;
    }

    while (fread(&tab, sizeof(table), 1, fp) == 1) {
        printf(" %d\t%s\n", tab.day, tab.course);
    }

    fclose(fp);

    return 0;
}